package com.songlin.houxin.admin.advices;


import com.songlin.houxin.common.core.util.R;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @author jinYuLinLang
 * @version 1.0.0
 * @ClassName ControllerAdvice.java
 * @Description <p></p>
 * @createTime 2022-09-29 08:38:00
 */
@ControllerAdvice
@Slf4j
public class HouxinControllerAdvice {

    @ExceptionHandler(Exception.class)
    public R exception(Exception e) {

        log.error("error:{}", e.getMessage());
        return R.failed(e.getMessage());
    }
}
